<Controls:MetroWindow x:Class="Caliburn.Metro.Demo.Views.ShellView"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
                      xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                      Title="Flyouts Demo"
                      Width="800"
                      Height="600"
                      BorderThickness="1"
                      SaveWindowPosition="True"
                      WindowStartupLocation="CenterScreen"
                      mc:Ignorable="d">

    <Controls:MetroWindow.BorderBrush>
        <SolidColorBrush Color="{DynamicResource AccentColor}" />
    </Controls:MetroWindow.BorderBrush>

    <Controls:MetroWindow.Flyouts>
        <Controls:FlyoutsControl x:Name="Flyouts">
            <Controls:FlyoutsControl.ItemContainerStyle>
                <Style BasedOn="{StaticResource {x:Type Controls:Flyout}}" TargetType="{x:Type Controls:Flyout}">
                    <Setter Property="Header" Value="{Binding Header}" />
                    <Setter Property="IsOpen" Value="{Binding IsOpen}" />
                    <Setter Property="Position" Value="{Binding Position}" />
                </Style>
            </Controls:FlyoutsControl.ItemContainerStyle>
        </Controls:FlyoutsControl>
    </Controls:MetroWindow.Flyouts>

    <Grid>
        <StackPanel Margin="10" HorizontalAlignment="Left">
            <TextBlock Margin="10"
                       FontSize="30"
                       Text="Some Flyout Tests..." />
            <Button MinWidth="90"
                    Margin="2"
                    cal:Message.Attach="[Event Click] = [Action ToggleFlyout(0)]"
                    Content="Show 1" />
            <Button MinWidth="90"
                    Margin="2"
                    cal:Message.Attach="[Event Click] = [Action ToggleFlyout(1)]"
                    Content="Show 2" />
            <Button MinWidth="90"
                    Margin="2"
                    cal:Message.Attach="[Event Click] = [Action ToggleFlyout(2)]"
                    Content="Show 3" />
            <Button MinWidth="90"
                    Margin="2"
                    cal:Message.Attach="[Event Click] = [Action ToggleFlyout(3)]"
                    Content="Settings" />
            <Button x:Name="Close"
                    MinWidth="90"
                    Margin="2"
                    Content="Close" />
        </StackPanel>

        <StackPanel Margin="10"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center">
            <Button MinWidth="90"
                    Margin="2"
                    cal:Message.Attach="[Event Click] = [Action ToggleFlyout(5)]"
                    Content="Show Top" />
            <Button MinWidth="90"
                    Margin="2"
                    cal:Message.Attach="[Event Click] = [Action ToggleFlyout(6)]"
                    Content="Show Bottom" />
        </StackPanel>

        <StackPanel Margin="10" HorizontalAlignment="Right">
            <Button MinWidth="90"
                    Margin="2"
                    cal:Message.Attach="[Event Click] = [Action ToggleFlyout(4)]"
                    Content="Show Left" />
        </StackPanel>
    </Grid>

</Controls:MetroWindow>